<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        var obj1 = {name: '小杨', age: 18};    //创建对象，并通过obj1变量保存对象的引用
        var obj2 = obj1;                       //将对象obj1的引用地址赋值给对象obj2
        var obj3 = obj2;                       //将对象obj2的引用地址赋值给对象obj3
        console.log(obj1 === obj2);            //比较obj1和obj2两个变量是否引用同一对象
        console.log(obj2 === obj3);            //比较obj2和obj3两个变量是否引用同一对象
        console.log(obj1 === obj3);            //比较obj1和obj3两个变量是否引用同一对象
        obj2.age = 19;                         //通过obj2修改obj1对象的属性
        console.log(obj1);                     //通过obj1调用obj1对象的属性
    </script>
</head>
<body>
    
</body>
</html>